package com.le.tester.javaThink.fifth.chapter18_Str;

import java.util.stream.Stream;

/**
 * createTime：2021/8/9 11:46
 * description：初始化的递归
 */
public class InfiniteRecursion {
    @Override
    public String toString() {
        //不要使用this,直接继承父类的toString即可
        //return "InfiniteRecursion{}" + this + "/n";
        return super.toString();
    }

    public static void main(String[] args) {
        Stream.generate(InfiniteRecursion::new)
                .limit(1)
                .forEach(System.out::println);
    }
}
